//
//  SectionTitleHeaderView.m
//  ImGuider
//
//  Created by 王鹏宇 on 2018/1/3.
//  Copyright © 2018年 imguider. All rights reserved.
//

#import "SectionTitleHeaderView.h"

@implementation SectionTitleHeaderView

- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier {
    
    self =[super initWithReuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.titleLabel = [[UILabel alloc] init];
        
        [self.contentView addSubview:self.titleLabel];
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self.contentView.mas_leading).offset(16);
            make.centerY.equalTo(self.contentView.mas_centerY);
            
            make.trailing.equalTo(self.contentView.mas_trailing).offset(-16);
        }];
        
//        UIView *lineView = [UIView new];
//        lineView.backgroundColor = kLineColor;
//
//        [self addSubview:lineView];
//
//        @weakify(self);
//        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
//            @strongify(self);
//
//            make.left.equalTo(self.mas_left).offset(16);
//            make.right.equalTo(self.mas_right).offset(-16);
//            make.bottom.equalTo(self.mas_bottom);
//            make.height.mas_equalTo(1);
//        }];
    }
    
    return self;
}


- (void)setSectionTitle:(NSString *)SectionTitle {
    
    self.titleLabel.text = SectionTitle;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
